package com.qingcloud.adminbackend.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qingcloud.adminbackend.base.AjaxResult;
import com.qingcloud.adminbackend.entity.source.DataSourceDatabase;
import com.qingcloud.adminbackend.utils.DbColumnInfo;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author wangjinnan
 * @since 2021-03-17
 */
public interface IDatabaseService extends IService<DataSourceDatabase> {

    List<String> getAllCatalogByDataSourceId(Integer dataSourceId);

    List<DbColumnInfo> getTableAndColumn(Integer dataSourceId, String catalog);

    DataSourceDatabase getDatabaseByDsName(String dsName);

    DataSourceDatabase getDatabaseByDsId(Integer dsId);

    List<DataSourceDatabase> getDatabaseByDsIds(String dsIds);

    AjaxResult addDatabase(DataSourceDatabase database);

    AjaxResult deleteDatabaseByIds(String ids);

    AjaxResult updateDatabase(DataSourceDatabase database);

    AjaxResult<List<DataSourceDatabase>> findDatabaseByIds(String ids);

    AjaxResult<List<DataSourceDatabase>> findDatabaseByName(String catalog);

    AjaxResult<List<Map<String, Object>>> getTypes();
}
